//
//  Da_WebController.swift
//  SWIFT_LEARN
//
//  Created by youxin on 2018/1/15.
//  Copyright © 2018年 YST. All rights reserved.
//

import UIKit

class Da_WebController: UIViewController {

   var utlStr   = NSString()
   var titleStr = String()
   let webView : UIWebView = UIWebView(frame:UIScreen.main.bounds)
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.title = titleStr as String
        
        self.view .addSubview(webView)
       
        if utlStr.components(separatedBy: "http").count > 1 {
            
            print("包含")
            let url = URL(string:utlStr as String)
            let request  = NSURLRequest(url:url!)
            webView.loadRequest(request as URLRequest)
            
        } else {
            print("不包含")
        }
        
       
        
        
    }
   //字符串 https://www.jianshu.com/p/52e7580166ff
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
